package com.tangsm.spring.boot.event.publisher.listener.controller;

import com.tangsm.spring.boot.event.publisher.listener.domain.User;
import com.tangsm.spring.boot.event.publisher.listener.service.UserRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 事件发布订阅实例测试接口控制器
 *
 * @author tangsm
 */
@RestController
@RequestMapping("/user")
public class UserRegisterController {
    @Autowired
    private UserRegisterService userRegisterService;

    /**
     * 用户注册
     *
     * @param user 用户信息
     * @return 结果
     */
    @RequestMapping("/register")
    public String register(User user) {
        userRegisterService.register(user);
        return "[controller]注册用户成功！";
    }
}
